<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="admin/Hui/lib/html5.js"></script>
<script type="text/javascript" src="admin/Hui/lib/respond.min.js"></script>
<script type="text/javascript" src="admin/Hui/lib/PIE_IE678.js"></script>

<![endif]-->
<link type="text/css" rel="stylesheet" href="admin/Hui/css/H-ui.css" />
<link type="text/css" rel="stylesheet"
	href="admin/Hui/css/H-ui.admin.css" />
<link type="text/css" rel="stylesheet"
	href="admin/Hui/font/font-awesome.min.css" />
<!--[if IE 7]>
<link href="admin/Hui/font/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<script type="text/javascript" src="admin/Hui/js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="admin/Hui/lib/layer1.9/layer.js"></script>
<title>添加报障</title>
</head>
<body>
	<script>
		$(function() {
			
			$("#user_phone").on("blur", function() {
				$.post("repair!checkRepair.action", {
					user_phone : $("#user_phone").val()
				}, function(data, status) {
					if (data == 0) {
						layer.msg('该电话已经存在报障信息中，不用重复报障');
					}
				});
			});
			
			$("#insert").on("click", function() {
				$.post("repair!checkRepair.action", {
					user_phone : $("#user_phone").val()
				}, function(data, status) {
					if (data == 0) {
						layer.msg('该电话已经存在报障信息中，不用重复报障');
					}
				});
			});
		});
	</script>
	<nav class="breadcrumb">
		<span><img src="admin/images/leftico01.png" /></span> 报障管理 <span
			class="c-gray en">&gt;</span> 等待处理 <a
			class="btn btn-success radius r mr-20"
			style="line-height: 1.6em; margin-top: 3px"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="icon-refresh"></i></a>
	</nav>
	<div class="pd-20">
		<div class="Huiform">
			<form action="repair!insert.action" method="post">
				<input type="hidden" name="error" value="${error}">
				<table class="table table-bg">
					<tbody>
						<tr>
							<th width="100" class="text-r"><span class="c-red">*</span>
								报障人：</th>
							<td><input type="text" style="width: 500px"
								class="input-text" id="user_name" name="user_name" placeholder="报障人2-10位"
								datatype="*2-10" errormsg="2-10位" nullmsg="报障人不能为空" value="${repair.user_name}">
							</td>
						</tr>
						<tr>
							<th class="text-r"><span class="c-red">*</span> 电话：</th>
							<td><input type="text" style="width: 500px" placeholder="短号或长号"
								class="input-text" id="user_phone" name="user_phone"
								datatype="/(^[0-9]{4,6}$)|(^[0-9]{11}$)/" nullmsg="电话不能为空"
								errormsg="4-6或11位数字" value="${repair.user_phone}">
								<span style="color:red" >${userPhoneError}</span>
								</td>
						</tr>
						
						<tr>
							<th class="text-r"><span class="c-red">*</span> 宿舍：</th>
							<td><input type="text" style="width: 500px" placeholder="宿舍格式如“01#101”"
								class="input-text" id="repair_addr" name="repair_addr"
								datatype="/^[0-9]{1,2}#[0-9]{3}$/" nullmsg="宿舍不能为空" errormsg="宿舍格式如“33#101”" value="${repair.repair_addr}"></td>
						</tr>
						<tr>
							<th class="text-r"><span class="c-red">*</span> 上门时间：</th>
							<td><label> <input name="go_time" type="radio"
									id="go_time0" value="10:00-13:00" checked> 10:00-13:00
							</label> <label> <input type="radio" name="go_time" value="17:00-21:00"
									id="go_time1"> 17:00-21:00
							</label></td>
						</tr>
						<tr>
							<th class="text-r"><span class="c-red">*</span> 机型：</th>
							<td><label> <input name="type" type="radio"
									id="type0" value="电脑" checked> 电脑
							</label> <label> <input type="radio" name="type" value="手机"
									id="type1"> 手机
							</label></td>
						</tr>
						<tr>
							<th class="text-r"><span class="c-red">*</span> 型号：</th>
							<td><input type="text" style="width: 500px" placeholder="型号不能为空"
								class="input-text" id="model" name="model" value="${repair.model}"
								datatype="*" nullmsg="型号不能为空" errormsg="型号不能为空"></td>
						</tr>
						<tr>
							<th class="text-r"><span class="c-red">*</span> 描述：</th>
							<td>
							
								<textarea name="repair_content" style="width: 500px" cols=""
									rows="" class="textarea" placeholder="故障描述不能为空"
									datatype="*" dragonfly="true" nullmsg="故障描述不能为空"
									errormsg="故障描述不能为空" value="${repair.repair_content}"></textarea>
								</td>
						</tr>
						<tr>
							<th>
							</th>
							<td><button 
									class="btn btn-success radius" type="submit" id="insert">
									<i class="icon-ok"></i> 确定
								</button>
								<a href="javascript:history.go(-1);"
									class="btn btn-secondary radius" id="insert">
									<i class="icon-ok"></i> 返回
								</a>	
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
	<script type="text/javascript" src="admin/Hui/lib/jquery.min.js"></script>
	<script type="text/javascript" src="admin/Hui/lib/Validform_v5.3.2.js"></script>
	<script type="text/javascript" src="admin/Hui/js/H-ui.js"></script>
	<script type="text/javascript" src="admin/Hui/js/H-ui.admin.js"></script>
	<script type="text/javascript">
		$(".Huiform").Validform();
		$(document).ready(function(){
			if($("error").val() != null && $("error").val() != "")
				{
					layer.msg('新增失败，发生异常');
				}
		});
		
	</script>


</body>
</html>